
const { ccclass, property } = cc._decorator;

@ccclass
export default class UIItemDay extends cc.Component {

    @property(cc.Label)
    lbDay: cc.Label = null
    @property(cc.Sprite)
    spSel: cc.Sprite = null

    index
    day
    cb

    setDay(index, day, sel, cb) {
        this.index = index;
        this.day = day;
        this.cb = cb;

        this.lbDay.string = day;
        this.spSel.enabled = sel;
    }

    onClickItem() {
        if (this.cb) {
            this.cb(this.index, this.day);
        }
    }

}
